#include "file_handle.h"
#include <fcntl.h>
#include <unistd.h>

int8_t file_read(char* file, char* content, uint16_t len) {

    int fd = 0; //文件描述符
    int ret = 0;//状态 /长度
    //打开
    fd = open(file, O_RDONLY);
    if (fd == -1)  return -1;
    //读取
    ret = read(fd, content, len);
    //关闭
    close(fd);
    return ret;
}